﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Web;

namespace WebApplication2.Models
{
    public class StuInfo
    {
        public int ID { get; set; }
        [Display(Name = "姓名")]
        [Required(ErrorMessage = "您需要填写{0}!")]
        [StringLength(50, MinimumLength = 3)]
        public string Name { get; set; }
        [Display(Name = "年龄")]
        [Range(1, 150, ErrorMessage = "年龄填写不正确！")]
        public int Age { get; set; }
        [Display(Name = "身高")]
        [Range(typeof(decimal), "50.00", "250.00", ErrorMessage = "身高超出指定范围!")]
        public decimal Height { get; set; }
        [Display(Name = "生日")]
        [DataType(DataType.Date)]
        public DateTime Birthday { get; set; }
        [Display(Name = "电子邮箱")]
        [RegularExpression(@"(\w)+(\.\w+)*@(\w)+((\.\w+)+)", ErrorMessage = "{0}格式不正确!")]
        public string Email { get; set; }

    }
}